﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace JmShared
{
    public abstract class LoginResponse
    {
        public bool Success { get; set; }
        public string Error { get; set; }
        public string Username { get; set; }

        public ClientList ClientList { get; set; }

        //public UserInfo User { get; set; }

        public LoginResponse() { }
        /// <summary>
        /// A failed login attempt. The error string will be passed to the connecting client.
        /// </summary>
        /// <param name="error"></param>
        public LoginResponse(string error)
        {
            this.Success = false;
            this.Error = error;
        }
        /// <summary>
        /// A successful login attempt. The user settings and client list must be passed to the client.
        /// </summary>
        /// <param name="userSettings"></param>
        /// <param name="clientList"></param>
        public LoginResponse(string username, ClientList clientList)
        {
            this.Success = true;
            this.Username = username;
            
            this.ClientList = clientList;
        }
    }
}
